home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Reference Guide / C-C++ Interactive Reference Guide.iso / c_ref / csource5 / 349_01 / sss.arc / EX_0305.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1991-04-09  |  675 b   |  45 lines

  1. Program EX_0305;
  2. {Listing 5P - see documentation in TUTOR.SSS}
  3.  
  4. uses SSS;
  5. { For Pascal other than Turbo/Quick erase above line }
  6.  
  7. { For MS Pascal $include:'SSSP1.H' }
  8.  
  9. var
  10.   i, c: integer;
  11.  
  12. { For MS Pascal $include:'SSSP2.H' }
  13.  
  14. procedure prime;
  15. begin
  16.   INIQUE(0,0,2);
  17.   INISTA(1,'Out of stock',0,0,0,0);
  18.   INISTA(2,'Ave stock',1,0,0,0);
  19. end;
  20.  
  21. begin
  22.  
  23.   prime;
  24.  
  25.   for i:=1 to 3 do
  26.  
  27.   begin
  28.     c := 15;
  29.     SETT(30*(i-1));
  30.     TALLY(2,c);
  31.     SETT(T + EX(2));
  32.  
  33.     while T <= 30*i do
  34.     begin
  35.       if c > 0 then c := c - 1 else TALLY(1,1);
  36.       TALLY(2,c);
  37.       SETT(T + EX(2));
  38.     end;
  39.  
  40.   end;
  41.  
  42.   SUMRY('');
  43.  
  44. end.
  45.